package ControlLayer;
import ModelLayer.*;
import java.util.ArrayList;
/**
 * Write a description of class DvdCtr here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class DvdCtr
{
    private DvdContainer dvdContainer;

    public DvdCtr()
    {
        dvdContainer = dvdContainer.getInstance();
    }

    public void createDvd(String barcode, String title, String artist, String publicationDate)
    {
        dvdContainer.createDvd(barcode, title, artist, publicationDate);
    }

    public int createCopy(String title,String serialNumber, String purchaseDate, String purchasePrice)
    {
        return dvdContainer.createCopy(title, serialNumber,  purchaseDate,  purchasePrice);
    }

    public Dvd findDvd(String title)
    {
        Dvd a = dvdContainer.findDvd(title);
        return a;
    }

    public void setTitle(String newTitle, String title)
    {
        findDvd(title).setTitle(newTitle);
    }

    public void removeDvd(String title)
    {
        dvdContainer.removeDvd(title);
    }

    public void removeCopy(String serialNumber, String title)
    {
        dvdContainer.removeCopy(serialNumber, title);
    }

    public Copy findCopy(String serialNumber, String title)
    {
        return dvdContainer.findCopy(serialNumber, title);
    }

    public void updateSerialNumber(String title, String serialNumber, String newSerial)
    {
        findDvd(title).findCopy(serialNumber).setSerialNumber(newSerial);
    }

    public void updatePurchaseDate(String title, String serialNumber, String newDate)
    {
        findDvd(title).findCopy(serialNumber).setPurchaseDate(newDate);
    }

    public void updatePurchasePrice(String title, String serialNumber, String newPrice)
    {
        findDvd(title).findCopy(serialNumber).setPurchasePrice(newPrice);
    }

    public ArrayList<Dvd> getList()
    {
        return dvdContainer.getList();
    }
    
    public void printCopyList(String title)
    {
        findDvd(title).printCopyList();
    }
}